<?php

class m130817_091113_create_table_passports extends CDbMigration
{
	public function up()
	{
		$this->createTable('{{passports}}',array(
			'id'=>'pk',
			'client_id'=>'INT(11) NOT NULL',
			'series'=>'INT(4) NOT NULL',
			'number'=>'INT(6) NOT NULL',
			'issued_by'=>'VARCHAR(255) NULL DEFAULT NULL',
			'issued_date'=>'DATE NULL DEFAULT NULL',
			'subdivision_code' => 'INT(6) NULL DEFAULT NULL',
			'type' => 'INT(1) NOT NULL DEFAULT 1',
			'created_at' => 'DATETIME NOT NULL',
			'updated_at' => 'TIMESTAMP NOT NULL',
		));
	}

	public function down()
	{
		$this->dropTable('{{passports}}');
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}